﻿using Quickly.Identity.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Quickly.Identity
{
    public static class QueryableExtensions
    {
        public static IQueryable<T> TakePage<T>(this IQueryable<T> queryable, Paging paging)
        {
            var skipCount = paging.GetSkipCount();

            return queryable.Skip(skipCount).Take(paging.Size);
        }
    }
}
